<template>
    <div v-loading="flag">
        <cassotable :colList="col" :tablelist="tableData" :opt="true"></cassotable>
    </div>
</template>


<script>
import cassotable from "../../common/casso_table.vue"
export default {
    components:{
        cassotable
    },
    data() {
        return {
            tableData:[],
            col:[
                { props: "pk", label: "系统ID" },
				{ props: "depar_name", label: "部门名称" },
				{ props: "depar_type", label: "部门类型" },
				// { props: "status", label: "登录状态" },
            ],
            flag:true
        }
    },
    methods: {
        getDepars(){
            this.$ajax.get("/depar").then(res=>{
                console.log(res.data)
                res.data.forEach(element => {
                    if(element.depar_type===1){
                        element.depar_type = "总经办"
                    }else if(element.depar_type===2){
                        element.depar_type= "部门"
                    }else{
                        element.depar_type= "班组"
                    }
                });
                this.tableData = res.data;
                this.flag = false;
            })
        }
    },
    mounted() {
        this.getDepars()
    },
}
</script>

<style lang="scss" scoped>
    
</style>